import request from '@/utils/request'

export function getAreaInfo (schoolId) {
  if (schoolId === 0) {
    return request({
      url: 'area/overview',
      method: 'get'
    })
  } else {
    return request({
      url: 'area/overview',
      method: 'get',
      params: {
        'school-id': schoolId
      }
    })
  }
}

export function getSchoolRank (schoolId) {
  if (schoolId === 0) {
    return request({
      url: 'area/school-rank',
      method: 'get'
    })
  } else {
    return request({
      url: 'area/school-rank',
      method: 'get',
      params: {
        'school-id': schoolId
      }
    })
  }
}

export function getSchoolOverview (schoolId) {
  if (schoolId === 0) {
    return request({
      url: 'school/overview',
      method: 'get'
    })
  } else {
    return request({
      url: 'school/overview',
      method: 'get',
      params: {
        'school-id': schoolId
      }
    })
  }
}
